<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:p="http://primefaces.org/ui"
                template="../templates/ui.xhtml">

    <ui:define name="content">

        <h1 class="title ui-widget-header ui-corner-all">Charts - Bar</h1>
        <div class="entry">
            <p>BarChart displays a CartesianChartModel.</p>

            <p:barChart value="#{chartBean.categoryModel}" legendPosition="ne"
                        title="Basic Bar Chart" min="0" max="200" style="height:300px"/>

            <p:barChart value="#{chartBean.categoryModel}" legendPosition="se" style="height:300px;margin-top:20px"
                        title="Horizontal Bar Chart" orientation="horizontal" min="0" max="200"/>

            <p:barChart value="#{chartBean.categoryModel}" legendPosition="ne" style="height:300px;margin-top:20px"
                        title="Stacked Bar Chart" stacked="true" barMargin="50" min="0" max="300"/>

            <h3>Source</h3>
            <p:tabView>
                <p:tab title="barChart.xhtml">
                    <pre name="code" class="xml">
&lt;p:barChart value="\#{chartBean.categoryModel}" legendPosition="ne"
            title="Basic Bar Chart" min="0" max="200" style="height:300px"/&gt;

&lt;p:barChart value="\#{chartBean.categoryModel}" legendPosition="se" style="height:300px"
            title="Horizontal Bar Chart" orientation="horizontal" min="0" max="200"/&gt;

&lt;p:barChart value="\#{chartBean.categoryModel}" legendPosition="ne" style="height:300px"
            title="Stacked Bar Chart" stacked="true" barMargin="50" min="0" max="300"/&gt;
                    </pre>
                </p:tab>

                <p:tab title="ChartBean.java">
                    <pre name="code" class="java">
package org.primefaces.examples.view;

import java.io.Serializable;

import org.primefaces.model.chart.CartesianChartModel;
import org.primefaces.model.chart.ChartSeries;

public class ChartBean implements Serializable {

    private CartesianChartModel categoryModel;

	public ChartBean() {
        createCategoryModel();
	}

    public CartesianChartModel getCategoryModel() {
        return categoryModel;
    }

    private void createCategoryModel() {
        categoryModel = new CartesianChartModel();

        ChartSeries boys = new ChartSeries();
        boys.setLabel("Boys");

        boys.set("2004", 120);
        boys.set("2005", 100);
        boys.set("2006", 44);
        boys.set("2007", 150);
        boys.set("2008", 25);

        ChartSeries girls = new ChartSeries();
        girls.setLabel("Girls");

        girls.set("2004", 52);
        girls.set("2005", 60);
        girls.set("2006", 110);
        girls.set("2007", 135);
        girls.set("2008", 120);

        categoryModel.addSeries(boys);
        categoryModel.addSeries(girls);
    }
}
                    </pre>
                </p:tab>
            </p:tabView>

        </div>

    </ui:define>
</ui:composition>
